package imitate_LinkedList;

import java.util.LinkedList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-04-14
 * Time: 15:44
 */
public class Test {
    public static void main(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addFirst(12);
        myLinkedList.addFirst(12);
        myLinkedList.addFirst(34);
        myLinkedList.addFirst(56);

        myLinkedList.display();

        myLinkedList.addLast(10);
        myLinkedList.display();

        myLinkedList.addIndex(5,100);
        myLinkedList.display();

        //移除第一次出现的关键字key
        myLinkedList.remove(12);
        myLinkedList.display();

        //移除全部key
        myLinkedList.removeAllKey(12);
        myLinkedList.display();

        System.out.println(myLinkedList);

        //清空双链表的内容
/*        myLinkedList.clear();
        myLinkedList.display();*/
    }
}
